package io.github.talelin.latticy.laver.controller.v1;

import io.github.talelin.latticy.mapper.BannerMapper;
import io.github.talelin.latticy.model.BannerDO;
import io.github.talelin.latticy.laver.service.TestSleeveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName TestSleeveController
 * @Description TODO
 * @Author wushaopei
 * @Date 2021/10/17 14:11
 * @Version 1.0
 */
@RequestMapping("/v1/sleeve")
@RestController
public class TestSleeveController {

    @Autowired
    private BannerMapper bannerMapper;

    @Autowired
    private TestSleeveService testSleeveService;

    @GetMapping("/test")
    public String test(){
        return "test v1";
    }

    @GetMapping("/test1")
    public List<BannerDO> test1(){
        return testSleeveService.getBanners();
    }

    @GetMapping("/test2")
    public long test2(){
        return testSleeveService.insertBanner();
    }

    @GetMapping("/test3")
    public List<BannerDO> test3(){
        return bannerMapper.selectList(null);
    }

}
